<template>
  <el-menu class="el-menu-vertical-demo aside-container"
           default-active="2" text-color="#666">
    <!-- 将菜单数据传递给子组件 -->
    <TreeMenu :menuData="menuData" :index="1" />
  </el-menu>
</template>

<script setup>
import TreeMenu from './treeMenu.vue'
import { useRouter } from 'vue-router'
import { reactive } from 'vue'

const router = useRouter()
const menuData = reactive(router.options.routes[0]).children
</script>

<style lang="less" scoped>
.aside-container {
  height: 100%;
}
</style>